/**
 * @file server.cc
 * @author zziywang (zziywang@163.com)
 * @brief { life is too short to learn cpp! }
 * @version 1.0
 * @date 2022-05-07
 *
 * @copyright Copyright (c) 2022
 *
 */

#include "Acceptor.hh"
#include "TcpConnection.hh"
#include <iostream>
#include <sstream>
using namespace std;
using namespace snow;

int main()
{
    Acceptor acceptor("172.25.40.81", 9999);
    acceptor.ready();

    TcpConnection tcp(acceptor.accept());
    cout << tcp.printTcp() << " has connected!" << endl;
    tcp.send("Welcome to EchoServer\n"); // 发送
    // while (1) {
        cout << ">> client data:" << endl;
        cout << tcp.recvLine(); // 接收一行数据
    // }

    return 0;
}